import { createRouter ,createWebHashHistory} from "vue-router";
// 创建路由器实例，管理多个路由
export default createRouter({
    history:createWebHashHistory(),
    routes:[
        {
            path:'/home',
            component:()=>import('@/pages/home/index.vue')
        },
        {
            path:'/hospital',
            component:()=>import('@/pages/hospital/index.vue'),
            // 详情页面的子路由
            children:[
                {
                    path:'register',
                    component:()=>import('@/pages/hospital/register/index.vue')
                },
                {
                    path:'close',
                    component:()=>import('@/pages/hospital/close/index.vue')
                },
                {
                    path:'search',
                    component:()=>import('@/pages/hospital/search/index.vue')
                },
                {
                    path:'detail',
                    component:()=>import('@/pages/hospital/detail/index.vue')
                },
                {
                    path:'notice',
                    component:()=>import('@/pages/hospital/notice/index.vue')
                },
                {
                    path:'register_step1',
                    component:()=>import('@/pages/hospital/register/register_step1.vue')
                }
            ]
        },
        {
            path:'/wxlogin',
            component:()=>('@/pages/wxlogin/index.vue')
        },
        {
            path:'/',
            redirect:'/home'
        }
    ],
    // 控制滚动条位置,默认最上方
    scrollBehavior(){
        return{
            left:0,
            top:0
        }
    }
})